
<?php
error_reporting(E_ALL);

include_once('controller/includes/constants.php');
include_once('controller/includes/Template.php');
include_once('controller/includes/functions.php');
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link rel="stylesheet" href="styles/style.css" type="text/css" charset="utf-8" media="screen" />

    </head>
    <body>
          <div id="tableWrapper" style="width: 100%; ">
          <table id="vsTable">

                <tr>
                    <td colspan="3" class="title" style="width: 100%;" ><?php include_once('controller/includes/header.php'); ?></td>
                </tr>
                <tr>
                 <td colspan="3" class="title" style="width: 100%;"><div><a href="product_add.php" >add product</a></div></td>
                </tr>
       
                <?php
// put your code here
                $q = new Query;
                $q
                        ->select('*'
                        )
                        ->from('`product`')
                        ->order_by(
                                array(
                                    '`product`.`naam` ASC',
                                )
                        )
                        ->run();

                $result = $q->run();
                $count = $q->get_selected_count();

                if (!($result && $count > 0)) {
                    echo 'No users found.' . "\n";
                } else {
                    while ($rows = mysql_fetch_object($result)) {

            echo'<tr  class="second"><td style="width:60%; ">' . $rows->naam . '</div><div></td>
           <td  style="width:20%; "><div><a href="product_edit.php?pid=' . $rows->product_id . '">detail</a></div></td>
            <td style="width: 20%; "><div><a href="product_del.php?pid=' . $rows->product_id . '">delete</a></div></td></tr>';
                    }
                }
                ?>

            </tbody>
        </table></div>

    </body>
</html>
